<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<c:set var="root" value="<%=request.getContextPath()%>" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>后台登录-${platformName}</title>

<meta name="description" content="User login page" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<script type="text/javascript"
	src='<c:url value="/js/boot.js"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>'></script>
<script type="text/javascript"
	src='<c:url value="/js/bootstrap/bootstrap.js"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>'></script>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/js/bootstrap/bootstrap.min.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/styles.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/font-awesome.min.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<!-- fonts -->
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/google-fonts.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<!-- ace styles -->
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/ace.min.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />
<link rel="stylesheet" type="text/css"
	href='<c:url value="/share/ace-rtl.min.css"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>' />

<style>
.Three-Dee {
	font-family: Garamond, serif;
	line-height: 1em;
	color: #FF6347;
	font-weight: bold;
	font-size: 42px;
	text-shadow: 0px 0px 0 rgb(-26, 229, -26), 1px 1px 0 rgb(-34, 221, -34),
		2px 2px 0 rgb(-42, 213, -42), 3px 3px 0 rgb(-50, 205, -50), 4px 4px 0
		rgb(-58, 197, -58), 5px 5px 0 rgb(-66, 189, -66), 6px 6px 0
		rgb(-74, 181, -74), 7px 7px 6px rgba(0, 0, 0, 0.15), 7px 7px 1px
		rgba(0, 0, 0, 0.5), 0px 0px 6px rgba(0, 0, 0, .2);
}
fieldset {
    border: 0 !important;
}
</style>
</head>

<body class="login-layout"
	style="background-image:url(${root}/share/images/bj.jpg);background-repeat:no-repeat;background-size:100% 100%;">
	<div class="main-container">
		<div class="main-content">
			<div class="row">
				<div class="col-sm-10 col-sm-offset-1">
					<div class="login-container">
						<div class="center">
							<h4 class="blue">&nbsp;</h4>
							<h1>
								<i class="icon-leaf green"></i> <span class="Three-Dee">${platformName}</span>
							</h1>
							<h4 class="blue">&nbsp;</h4>
						</div>

						<div class="space-6"></div>

						<div class="position-relative">
							<div id="login-box"
								class="login-box visible  widget-box no-border">
								<div class="widget-body">
									<div class="widget-main">
										<h4 class="header blue lighter bigger">
											<i class="icon-user green"></i> 请输入用户名/身份证号,密码
										</h4>

										<div class="space-6"></div>

										<form id="myform">
											<fieldset>
												<label class="block clearfix"> <span
													class="block input-icon input-icon-right"> <input
														type="text" class="form-control" name="username"
														placeholder="用户名/身份证号" /> <i class="icon-user"></i>
												</span>
												</label> <label class="block clearfix"> <span
													class="block input-icon input-icon-right"> <input
														id="password" type="password" class="form-control" name="password"
														placeholder="密码" /> <i class="icon-lock"></i>
												</span>
												</label>

												<div class="space"></div>

												<div class="clearfix">

													<button id="loginbutton" type="button" onclick="login();"
														class="width-35 pull-right btn btn-sm btn-primary">
														<i class="icon-key"></i> 登 录
													</button>
												</div>

												<div class="space-4"></div>
											</fieldset>
										</form>

									</div>
									<!-- /widget-main -->

									<div class="toolbar clearfix">
										<div style="width: 50px;">
											<a href="javascript:void(0)" class="forgot-password-link">
											</a>
										</div>

										<div style="width: 300px;">
											<a href="javascript:void(0)"
												onclick="show_box('signup-box'); return false;"
												class="user-signup-link"> &copy; 青岛宏图公司 </a>
										</div>
									</div>
								</div>
								<!-- /widget-body -->
							</div>
							<!-- /login-box -->
						</div>
						<!-- /position-relative -->
					</div>
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
	</div>
	<script type="text/javascript">
		if ("ontouchend" in document)
			document.write("<script src='${root}/js/jquery.mobile.custom.min.js'>"
							+ "<"+"/script>");
	</script>
	<script type="text/javascript"
		src='<c:url value="/js/my_noty.js"></c:url>?v=<%=JsVersionUtil.CURRENT_VERSION%>'></script>
	<!-- inline scripts related to this page -->
	<script type="text/javascript">
	 
		$('#password').bind('keypress', function(event) {
			if (event.keyCode == "13") {
				login();
			}
		});
		function login() {
			$('#loginbutton').popover('destroy');
			$.ajax({
				url : "<c:url value='/login/vertify'></c:url>",
				type : 'post',
				dataType : 'json',
				data : {
					"username" : $("input[name='username']").val(),
					"password" : $("input[name='password']").val()
				},
				success : function(data) {
					if (data.isSuccess) {
						/* if (parent.document.getElementById('contentFrame')) {
							var src = parent.document
									.getElementById('contentFrame').src
							if (src) {
								location.href = src;
							}else{
								location.href = "<c:url value='/mng'></c:url>";
							}
						} else {
							location.href = "<c:url value='/mng'></c:url>";
						} */
						location.href = "<c:url value='/mng'></c:url>";
					} else {
						_noty($('#loginbutton'), data.info, 'left', 2000);
					}
				},
				error : function(req) {
					_noty($('#loginbutton'), '服务器异常！！', 'left', 2000);
				},
				complete : function(XHR, TS) {
					XHR = null;
				}
			});
		}
	</script>
</body>
</html>
